/* 富文本编辑器容器 */
.rich-text-editor-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* TipTap编辑器主体 */
.tiptap-editor {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
}

/* 浅色主题 */
.tiptap-editor.light {
  background-color: #ffffff;
  color: #000000;
}

/* 深色主题 */
.tiptap-editor.dark {
  background-color: #1e1e1e;
  color: #d4d4d4;
}

/* 段落样式 */
.tiptap-editor p {
  margin: 0 0 1em 0;
}

.tiptap-editor p:last-child {
  margin-bottom: 0;
}

/* 标题样式 */
.tiptap-editor h1,
.tiptap-editor h2,
.tiptap-editor h3,
.tiptap-editor h4,
.tiptap-editor h5,
.tiptap-editor h6 {
  margin: 1.5em 0 0.5em 0;
  font-weight: 600;
  line-height: 1.3;
}

.tiptap-editor h1 { font-size: 2em; }
.tiptap-editor h2 { font-size: 1.5em; }
.tiptap-editor h3 { font-size: 1.25em; }
.tiptap-editor h4 { font-size: 1.1em; }
.tiptap-editor h5 { font-size: 1em; }
.tiptap-editor h6 { font-size: 0.875em; }

/* 列表样式 */
.tiptap-editor ul,
.tiptap-editor ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.tiptap-editor li {
  margin: 0.25em 0;
}

/* 任务列表样式 */
.tiptap-editor ul[data-type="taskList"] {
  list-style: none;
  padding-left: 0;
}

.tiptap-editor ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
}

.tiptap-editor ul[data-type="taskList"] li > label {
  margin-right: 0.5em;
  user-select: none;
}

.tiptap-editor ul[data-type="taskList"] li > div {
  flex: 1;
}

/* 引用块样式 */
.tiptap-editor blockquote {
  border-left: 3px solid #ccc;
  padding-left: 1em;
  margin: 1em 0;
  color: #666;
}

.tiptap-editor.dark blockquote {
  border-left-color: #555;
  color: #aaa;
}

/* 代码块样式 */
.tiptap-editor pre {
  background-color: #f5f5f5;
  border-radius: 4px;
  padding: 1em;
  margin: 1em 0;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
}

.tiptap-editor.dark pre {
  background-color: #2d2d2d;
}

.tiptap-editor code {
  background-color: #f5f5f5;
  border-radius: 3px;
  padding: 0.2em 0.4em;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
}

.tiptap-editor.dark code {
  background-color: #2d2d2d;
}

/* 表格样式 */
.tiptap-editor table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  overflow: hidden;
}

.tiptap-editor th,
.tiptap-editor td {
  border: 1px solid #ddd;
  padding: 0.5em;
  text-align: left;
  min-width: 100px;
}

.tiptap-editor.dark th,
.tiptap-editor.dark td {
  border-color: #555;
}

.tiptap-editor th {
  background-color: #f5f5f5;
  font-weight: 600;
}

.tiptap-editor.dark th {
  background-color: #2d2d2d;
}

/* 链接样式 */
.tiptap-editor a {
  color: #1890ff;
  text-decoration: underline;
  cursor: pointer;
}

.tiptap-editor a:hover {
  color: #40a9ff;
}

/* 图片样式 */
.tiptap-editor .editor-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 1em 0;
}

/* 高亮样式 */
.tiptap-editor mark {
  background-color: #fff566;
  padding: 0.1em 0.2em;
  border-radius: 2px;
}

.tiptap-editor.dark mark {
  background-color: #614700;
}

/* 分隔线样式 */
.tiptap-editor hr {
  border: none;
  border-top: 2px solid #ddd;
  margin: 2em 0;
}

.tiptap-editor.dark hr {
  border-top-color: #555;
}

/* 文本对齐 */
.tiptap-editor [style*="text-align: left"] { text-align: left; }
.tiptap-editor [style*="text-align: center"] { text-align: center; }
.tiptap-editor [style*="text-align: right"] { text-align: right; }
.tiptap-editor [style*="text-align: justify"] { text-align: justify; }

/* 占位符 */
.tiptap-editor .ProseMirror-placeholder {
  color: #aaa;
  pointer-events: none;
  height: 0;
}

.tiptap-editor.dark .ProseMirror-placeholder {
  color: #666;
}

/* 选中状态 */
.tiptap-editor ::selection {
  background-color: #b4d5fe;
}

.tiptap-editor.dark ::selection {
  background-color: #264f78;
}

/* 焦点状态 */
.tiptap-editor:focus {
  outline: none;
}

/* 滚动条样式 */
.tiptap-editor::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.tiptap-editor::-webkit-scrollbar-track {
  background: transparent;
}

.tiptap-editor::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.tiptap-editor::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.tiptap-editor.dark::-webkit-scrollbar-thumb {
  background: #555;
}

.tiptap-editor.dark::-webkit-scrollbar-thumb:hover {
  background: #777;
}
